import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 价格段表分页查询
 * @param {查询条件} data
 */
export function listLayPriceRange(query) {
  return request({
    url: 'business/LayPriceRange/list',
    method: 'get',
    params: query,
  })
}

/**
 * 价格段表tree查询
 * @param {查询条件} data
 */
export function treelistLayPriceRange(query) {
  return request({
    url: 'business/LayPriceRange/treelist',
    method: 'get',
    params: query,
  })
}
/**
 * 新增价格段表
 * @param data
 */
export function addLayPriceRange(data) {
  return request({
    url: 'business/LayPriceRange',
    method: 'post',
    data: data,
  })
}
/**
 * 修改价格段表
 * @param data
 */
export function updateLayPriceRange(data) {
  return request({
    url: 'business/LayPriceRange',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取价格段表详情
 * @param {Id}
 */
export function getLayPriceRange(id) {
  return request({
    url: 'business/LayPriceRange/' + id,
    method: 'get'
  })
}

/**
 * 删除价格段表
 * @param {主键} pid
 */
export function delLayPriceRange(pid) {
  return request({
    url: 'business/LayPriceRange/delete/' + pid,
    method: 'POST'
  })
}
// 导出价格段表
export async function exportLayPriceRange(query) {
  await downFile('business/LayPriceRange/export', { ...query })
}
